\(\int \frac {(a+b x) (A+B x)}{x^2} \, dx\) [86]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 22 \[ \int \frac {(a+b x) (A+B x)}{x^2} \, dx=-\frac {a A}{x}+b B x+(A b+a B) \log (x) \]

[Out]

-a*A/x+b*B*x+(A*b+B*a)*ln(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {77} \[ \int \frac {(a+b x) (A+B x)}{x^2} \, dx=\log (x) (a B+A b)-\frac {a A}{x}+b B x \]

[In]

Int[((a + b*x)*(A + B*x))/x^2,x]

[Out]

-((a*A)/x) + b*B*x + (A*b + a*B)*Log[x]

Rule 77

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rubi steps \begin{align*} \text {integral}& = \int \left (b B+\frac {a A}{x^2}+\frac {A b+a B}{x}\right ) \, dx \\ & = -\frac {a A}{x}+b B x+(A b+a B) \log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \frac {(a+b x) (A+B x)}{x^2} \, dx=-\frac {a A}{x}+b B x+(A b+a B) \log (x) \]

[In]

Integrate[((a + b*x)*(A + B*x))/x^2,x]

[Out]

-((a*A)/x) + b*B*x + (A*b + a*B)*Log[x]

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.05

method result size
default \(-\frac {a A}{x}+b B x +\left (A b +B a \right ) \ln \left (x \right )\) \(23\)
risch \(-\frac {a A}{x}+b B x +A \ln \left (x \right ) b +B \ln \left (x \right ) a\) \(23\)
norman \(\frac {b B \,x^{2}-A a}{x}+\left (A b +B a \right ) \ln \left (x \right )\) \(27\)
parallelrisch \(\frac {A \ln \left (x \right ) x b +B \ln \left (x \right ) x a +b B \,x^{2}-A a}{x}\) \(28\)

[In]

int((b*x+a)*(B*x+A)/x^2,x,method=_RETURNVERBOSE)

[Out]

-a*A/x+b*B*x+(A*b+B*a)*ln(x)

Fricas [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.18 \[ \int \frac {(a+b x) (A+B x)}{x^2} \, dx=\frac {B b x^{2} + {\left (B a + A b\right )} x \log \left (x\right ) - A a}{x} \]

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="fricas")

[Out]

(B*b*x^2 + (B*a + A*b)*x*log(x) - A*a)/x

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.86 \[ \int \frac {(a+b x) (A+B x)}{x^2} \, dx=- \frac {A a}{x} + B b x + \left (A b + B a\right ) \log {\left (x \right )} \]

[In]

integrate((b*x+a)*(B*x+A)/x**2,x)

[Out]

-A*a/x + B*b*x + (A*b + B*a)*log(x)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \frac {(a+b x) (A+B x)}{x^2} \, dx=B b x + {\left (B a + A b\right )} \log \left (x\right ) - \frac {A a}{x} \]

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="maxima")

[Out]

B*b*x + (B*a + A*b)*log(x) - A*a/x

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.05 \[ \int \frac {(a+b x) (A+B x)}{x^2} \, dx=B b x + {\left (B a + A b\right )} \log \left ({\left | x \right |}\right ) - \frac {A a}{x} \]

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="giac")

[Out]

B*b*x + (B*a + A*b)*log(abs(x)) - A*a/x

Mupad [B] (verification not implemented)

Time = 0.41 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \frac {(a+b x) (A+B x)}{x^2} \, dx=\ln \left (x\right )\,\left (A\,b+B\,a\right )+B\,b\,x-\frac {A\,a}{x} \]

[In]

int(((A + B*x)*(a + b*x))/x^2,x)

[Out]

log(x)*(A*b + B*a) + B*b*x - (A*a)/x